package com.bjsxt.service.impl;

import com.bjsxt.dao.UserManager;
import com.bjsxt.dao.impl.UserManagerImpl;
import com.bjsxt.pojo.Users;
import com.bjsxt.service.UserManagerService;

import java.util.List;

/*用户管理 业务层   调用持久层方法  实现操作*/
public class UserManagerServiceImpl implements UserManagerService {
    //添加用户
    @Override
    public void addUser(Users users) {
        UserManager userManager = new UserManagerImpl();
        userManager.insertUser(users);
    }

    /*查询用户*/
    @Override
    public List<Users> finduser(Users users) {
        UserManager userManager =new UserManagerImpl();
        return userManager.selectUserByProperty(users);
    }

    //预更新用户查询
    @Override
    public Users findUserById(int userid) {
        UserManager userManager = new UserManagerImpl();

        return userManager.selectUserByUserId(userid);
    }
    //更新户
    @Override
    public void modifyUser(Users users) {
        UserManager userManager = new UserManagerImpl();
        userManager.updateUserByUserid(users);
    }

    //删除用户
    @Override
    public void dropUser(int userid) {
        UserManager userManager = new UserManagerImpl();
        userManager.deleteUserByUserid(userid);
    }
}
